from appium import webdriver
cap = {}
cap['device']='android'
cap['platformName']='android'
cap['deviceName'] = '127.0.0.1:62001'
cap['version'] = '4.4'
cap['appPackage'] = 'com.miui.calculator'
cap['appActivity'] = '' #cal.CalculatorActivity

dr = webdriver.Remote('http://127.0.0.1:4723/wd/hub',cap)
# dr.implicitly_wait(20)
# dr.find_element_by_name('1').click()
# dr.find_element_by_id('com.miui.calculator:id/btn_plus').click()
# dr.find_element_by_name('2').click()
# dr.find_element_by_name('确定').click()
size = dr.get_window_size()
print(size)
x = size['width']
y = size['height']
dr.swipe(x/2,y/2,x/2+350,y/2,1000)